package com.gitee.srurl.core.util;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * @author zxw
 * @date 2023/4/29 8:36
 */
@Slf4j
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public abstract class UrlUtil {

    public static URL parse(String url) {

        try {
            return new URL(url);
        } catch (MalformedURLException e) {
            log.error("地址:{},解析失败！", url);
            return null;
        }
    }
}
